<?php
	// 加载公共文件
	include_once('../../public/config/config.php');
	include_once('../../public/config/sql.php');
	include_once('../../public/packfunc/strPoseJump.php');

	// 实例化对象
	$obj = new sql($info);

	// 接收pose方式的传值
	$file      =  isset($_FILES['file']) ? $_FILES['file'] : '';
	$author    =  isset($_POST['author']) ? $_POST['author'] : '';
	$cid       =  isset($_POST['cid']) ? $_POST['cid'] : '';
	$users     =  isset($_POST['users']) ? $_POST['users'] : '';
	$slide     =  isset($_POST['slide']) ? $_POST['slide'] : '';
	$content   =  isset($_POST['content']) ? $_POST['content'] : '';
	$describe  =  isset($_POST['describe']) ? $_POST['describe'] : '';

	// 文件的处理
	$uploadFile = new strPoseJump($file);
	$uploadFile = mb_substr($uploadFile->arry[0], 1);

	// 构建SQL语句
	$sql = "insert into article(cid,img,title,author,slide,`describe`,content) values('$cid','$uploadFile','$users','$author','$slide','$describe','$content')";

	if($obj->db_insert($sql)){

		header('location:../delayJump.php?param=article_lists');
	}else{

		header('location:../index.php?param=article_lists');
	}
?>